package xp.ass.imitate.express.meta.node;

import lombok.Data;
import xp.ass.imitate.express.impl.XExpressState;

import java.util.List;

/**
 * @author chent3
 * @date 2024/9/6
 * handle dot separated express such as  property1.property2.methodOne()
 */
@Data
public class CompoundTokenNode extends XTokenNode {

    public CompoundTokenNode(List<XTokenNode> tokenNodeList, int pos) {
        super(pos, tokenNodeList);
    }

    public Object getValue(XExpressState state){
        if (getChildNodeList().size() == 1) {
            // iftk_todo wait to implement
            return getChildNodeList().get(0).getValue(state);
        }
        XTokenNode xTokenNode = this.childNodeList.get(0);
        Object value = xTokenNode.getValue(state);

        return null;
    }

}
